import request from '@/utils/request'
//注册接口
export const userRegisterService = ({
  name,
  password,
  phone,
  address,
  sex,
  age
}) => {
  return request.post('user/register', {
    name,
    password,
    phone,
    address,
    sex,
    age
  })
}
//登录接口
export const userLoginService = ({ name, password }) => {
  return request.post('user/login', { name, password })
}
//获取用户基本信息
import { useUserStore } from '@/stores'

export const userGetInfoService = () => {
  const userStore = useUserStore()
  return request.get('my/userinfo', {
    headers: {
      // 在这里设置自定义请求头字段
      Authorization: userStore.token
    }
  })
}
